import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: 'home'
  },
  {
    path: "/continuous",
    redirect: 'detect'
  },
  {
    path: "/frequencySelecting",
    redirect: 'detectSelect'
  },
  
  {
    path: "/public",
    redirect: 'serveTiming'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/index.vue'),
    meta: { hideNavigationBar: false } // NavigationBar为true隐藏导航栏菜单
  },
  {
    path: '/control', 
    name: 'control',
    component: () => import('../views/control/index.vue'),
    meta: { hideNavigationBar: false } // 默认情况下不隐藏NavigationBar
  },
  {
    path: '/detect',
    name: 'detectSet',
    component: () => import('../views/detect/set.vue'),
    meta: { hideNavigationBar: false } // 默认情况下不隐藏NavigationBar
  },
  {
    path: '/detectResult',
    name: 'detectResult',
    component: () => import('../views/detect/result.vue'),
  },
  {
    path: '/detectResultTime',
    name: 'detectResultTime',
    component: () => import('../views/detect/resultTime.vue'),
  },
  {
    path: '/detectSelect',
    name: 'detectSelect',
    component: () => import('../views/detectSelect/set.vue'),
  },
  {
    path: '/detectSelectResult',
    name: 'detectSelectResult',
    component: () => import('../views/detectSelect/result.vue'),
  },
  {
    path: '/detectSelectResultTime',
    name: 'detectSelectResultTime',
    component: () => import('../views/detectSelect/resultTime.vue'),
  },
  {
    path: '/serveTiming',
    name: 'serveTiming',
    component: () => import('../views/serve/timing.vue'),
  },
  {
    path: '/serveTiming',
    name: 'serveTiming',
    component: () => import('../views/serve/timing.vue'),
  },
  {
    path: '/serveRealTime',
    name: 'serveRealTime',
    component: () => import('../views/serve/realTime.vue'),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

// router/index.js 页面

router.beforeResolve((to, from, next) => {
  // console.log(to,from);
  next()
})



export default router;
